package compilers.AST;

import java.io.PrintStream;

import compilers.compiler.PGenerator;
import compilers.exceptions.SemanticalException;
import compilers.symbolTable.SymbolTable;
import compilers.symbolTable.SymbolTableScope;

public class Node {
	
	private static int NODENR = 0;
	
	protected int fLineNr = 0;
	protected int fNodeId;
	
	public void print(int identLevel) {}
	public void checkSemantics(SymbolTableScope currentScope) throws SemanticalException {}
	public void generatePcode(PGenerator pGen, SymbolTableScope currentScope) {}
	public Node() {}
	
	public Node(int lineNr) {
		fLineNr = lineNr;
		fNodeId = NODENR;
		NODENR++;
	}
	
	public int getLine() {
		return fLineNr;
	}
	
	public int getNodeId() {
		return fNodeId;
	}
	
	public void setLine(int line) {
		fLineNr = line;
	}
	
	public void println(int identLevel, String out) {
		String result = "";
		for (int i = 1; i <= identLevel; i++) {
			result += "   ";
		}
		System.out.println(result + "-" + out);
	}
	
	
}
